<template>
  <div style="padding: 0 20px">
    <el-row style="margin-top: 20px">
      <el-col :span="12"
        ><strong>操作模块:</strong>{{ data.title }} /
        {{ typeFormat(data.businessType) }}</el-col
      >
      <el-col :span="12"><strong>请求地址:</strong>{{ data.operUrl }}</el-col>
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="12"
        ><strong>登陆信息:</strong>{{ data.operName }} / {{ data.operIp }}
      </el-col>
      <el-col :span="12"
        ><strong>请求方式:</strong>{{ data.requestMethod }}</el-col
      >
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="24"><strong>操作方法:</strong>{{ data.method }}</el-col>
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="24"><strong>请求参数:</strong>{{ data.operParam }}</el-col>
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="24"
        ><strong>返回参数:</strong>{{ data.jsonResult }}</el-col
      >
    </el-row>
    <el-row style="margin-top: 20px">
      <el-col :span="8"
        ><strong>操作状态:</strong
        >{{ data.status == 0 ? "正常" : "异常" }}</el-col
      >
      <el-col :span="8"
        ><strong>消耗时间:</strong>{{ data.costTime }} 毫秒</el-col
      >
      <el-col :span="8"><strong>操作时间:</strong>{{ data.operTime }}</el-col>
    </el-row>
  </div>
</template>

<script>
export default {
  dicts: ["sys_oper_type"],
  props: {
    data: {
      type: Object,
      default: () => {},
    },
  },
  data() {
    return {
      businessType: [
        "其它",
        "新增",
        "修改",
        "删除",
        "授权",
        "导出",
        "导入",
        "强退",
        "代码生成",
        "清空数据",
      ],
    };
  },
  methods: {
    // 操作日志类型字典翻译
    typeFormat(value) {
      return this.selectDictLabel(this.dict.type.sys_oper_type, value);
    },
  },
};
</script>

<style lang="scss" scoped>
strong {
  margin-right: 15px;
}
</style>